<template>
	<view>
		<view class="item d-s-c bg-white br12" v-for="(item,index) in list" :key="index">
			<view class="left flex-1 pr mr20">
				<view class="pos">
					<u-icon name="heart" size="20" color="#fff"></u-icon>
				</view>
				<u--image src="https://uviewui.com/album/1.jpg" width="120" height="120"></u--image>
				<view class="tags">
					<u-tag :text="item.status_name" size="mini" :bgColor="item.status==1?'#ea6b7c':'#1f305c'"
						borderColor="transparent"></u-tag>
				</view>
			</view>
			<view class="right">
				<view class="vertical name ">{{item.name}}</view>
				<view class="tags">
					<text v-for="(e,i) in item.tags" :key="i">{{e}}</text>
				</view>
				<div class="date d-s-c ">
					<u-icon name="calendar" size="20"></u-icon>
					<text>{{item.date}}</text>
				</div>
				<view class="date d-s-c ">
					<u-icon name="map" size="20"></u-icon>
					<text>{{item.address}}</text>
				</view>
				<view class="d-b-c mt10" v-if="!nomore">
					<view class="flex-1 mr20">
						<view v-if="item.urls&&item.urls.length>0">
							<view class="avatar-group">
								<u-avatar-group :urls="item.urls" size="25" maxCount='99' gap="0.4"></u-avatar-group>
							</view>
							<view class="gray9 f18 tr">
								{{item.urls.length}}/{{item.max}}人参与
							</view>
						</view>
					</view>
					<view class="btn">
						<u-button text="去报名" size="mini" color="#1f083c" v-if="item.status==1"></u-button>
						<u-button text="已满员" size="mini" color="#c0c0c0" v-else-if="item.status==2"></u-button>
					</view>
				</view>
			</view>
		</view>
		<u-loadmore :status="status" line></u-loadmore>
	</view>
</template>

<script>
	export default {
		name: "list",
		props: {
			list: {
				type: Array,
				default: () => {
					return []
				}
			},
			status: {
				type: String,
				default: ''
			},
			nomore: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style scoped lang="scss">
	.item {
		padding: 20rpx;
		margin-bottom: 20rpx;

		.left {

			.pos {
				position: absolute;
				right: 20rpx;
				top: 20rpx;
				z-index: 1;

			}

			.tags {
				position: absolute;
				bottom: 0;
				left: 0;
			}
		}

		.right {
			.name {
				font-size: 30rpx;
			}

			.tags {
				text {
					margin-right: 10rpx;
					color: #555;
					font-size: 20rpx;
					padding: 5rpx 10rpx;
					background-color: #f9f7fa;
				}
			}

			.date {
				color: #a5a4a7;
				font-size: 22rpx;
			}

			.avatar-group {
				position: relative;
				z-index: 1;

				&::after {
					position: absolute;
					content: "";
					width: 100%;
					height: 8rpx;
					background-color: #736484;
					left: 0;
					top: 50%;
					transform: translateY(-50%);
					z-index: -1;
				}
			}
		}
	}
</style>